#!/usr/local/env python3
#author:fonzie
import os
from flask import Flask, render_template
from flask_sqlalchemy import SQLAlchemy
from config import DevConfig

#配置静态文件以及模板的路径
static_folder = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'static')
template_folder = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'templates')

#初始化对象
SimpleManager = Flask(__name__, static_folder=static_folder, template_folder=template_folder)
SimpleManager.config.from_object(DevConfig)

db = SQLAlchemy(SimpleManager)


@SimpleManager.route("/")
def home():
    return render_template("index.html")

@SimpleManager.route("/status")
def status():
    return "status"

if __name__ == "__main__":
    SimpleManager.run()